package com.cloud.point.designPattern.strategy.impl;

import com.cloud.point.designPattern.strategy.DiscountType;
import com.cloud.point.designPattern.strategy.IDiscount;

import java.math.BigDecimal;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 折扣直减
 *
 * @author 24373
 * @version 1.0
 * @date 2024-06-02 11:21
 */
@Component
@Slf4j
public class ZJDiscount implements IDiscount {

    @Override
    public BigDecimal payService(BigDecimal price) {
        log.info("折扣直减");
        return price.subtract(new BigDecimal("10"));
    }

    @Override
    public DiscountType getType() {
        return DiscountType.ZJ;
    }

}
